package com.gict.antifraudback.utils;


import com.gict.antifraudback.entity.User;

/**
 * @author 18239
 */
public class UserThreadLocal {

    private static final ThreadLocal<User> THREAD_LOCAL = new ThreadLocal();

    private UserThreadLocal(){

    }

    /**
     *设置当前线程的user
     * @param user
     */
    public static void set(User user){
        THREAD_LOCAL.set(user);
    }

    /**
     * 返回当前线程中的user对象
     * @return
     */
    public static User get(){
        return THREAD_LOCAL.get();
    }

    /**
     删除当前线程中的User对象
     */
    public static void remove(){
        THREAD_LOCAL.remove();
    }

}
